#include<iostream>
using namespace std;
#include<string>
int main() {
	long long t, n;
	cin >> t >> n;
	int x = 1;
	while (x< t)
		x<<= 1;
	n %= x;
	string str;
	cin >> str;
	while (n--) {
		for (int i = t - 1; i >= 1; --i)
			str[i] = (str[i] - '0') ^ (str[i - 1] - '0') + '0';
	}
	cout << str;
}